10200 DIM MN$(12):MN$(1)="JAN.":MN$(2)="FEB.":MN$(3)="MAR.":MN$(4)="APR.":MN$(5)="MAY.":MN$(6)="JUN.":MN$(7)="JUL.":MN$(8)="AUG.":MN$(9)="SEP.":MN$(10)="OCT.":MN$(11)="NOV.":MN$(12)="DEC."
10400 PRINT " This program allows you to make calculations with time (years, weeks, days,":PRINT
10500 PRINT " hours, minutes and seconds), whole or decimal, with the ease of a pocket":PRINT
10600 PRINT " calculator. You will be presented with a screen form which you fill out":PRINT
10700 PRINT " using the cursor control keys <"CHR$(24)"> <"CHR$(25)"> <"CHR$(26)"> <"CHR$(27)"> to reach the blanks and":PRINT
10800 PRINT " numeric keys to fill them in.":PRINT
10900 PRINT " After entering a number you may use <"CHR$(17)CHR$(196)CHR$(217)"> to cause the results to be ":PRINT
11000 PRINT " calculated or the cursor keys to move to another part of the entry line.":PRINT
11100 PRINT " Once the blanks are filled, new calculations can be made by changing any":PRINT
11200 PRINT " of them and pressing <"CHR$(17)CHR$(196)CHR$(217)">":PRINT
11300 PRINT " Before running the program you may program the function keys with frequently ":PRINT
11400 PRINT " used constants with the BASIC command {KEY #,"CHR$(34)"------"CHR$(34)"}. Pressing <Alt>+<F1>":PRINT
11500 PRINT " during the program will list function key operations on screen line 25."
11600 MES$(1)= "Please press any key to continue except press <Esc> to end the program. "
11700 MES$(2)= " Use <"+CHR$(24)+"><"+CHR$(25)+"><"+CHR$(26)+"><"+CHR$(27)+"> keys to move, <"+CHR$(17)+CHR$(196)+CHR$(217)+"> key to calculate, <Esc> to end. "
11800 MES$(3)= " Use <"+CHR$(26)+">, <"+CHR$(27)+"> and <space bar> to select the function. "
11900 MES$(4)= " <Alt>+<F1> will list all of the function key functions on screen line 25. "
12000 MES$(5)= " <Alt>+<F2> will clear the data entry field at the location of the pointer. "
12100 MES$(6)= " <Alt>+<F3> will transfer the result line to the first input data line. "
12200 MES$(7)= " <Alt>+<F4> will clear data from the entire data line containing the pointer. "
12300 MES$(8)= " <Alt>+<F5> will transfer the result line to the last input data line. "
12400 MES$(9)= " <Alt>+<F6> duplicates the function of the <"+CHR$(24)+"> key {CURSOR UP}. "
12500 MES$(10)= " <Alt>+<F7> duplicates the function of the <"+CHR$(27)+"> key {CURSOR LEFT}. "
12600 MES$(11)= " <Alt>+<F8> duplicates the function of the <"+CHR$(26)+"> key {CURSOR RIGHT}. "
12700 MES$(12)= " <Alt>+<F9> duplicates the function of the <Del> key. "
12800 MES$(13)= " <Alt>+<F10> duplicates the function of the <"+CHR$(25)+"> key {CURSOR DOWN}. "
12900 MES$(14)= " <shift>+<F1> will store the first data line in a temporary register. "
13000 MES$(15)= " <shift>+<F2> will recall the stored first data line to the first data line. "
13100 MES$(16)= " <shift>+<F3> will store the constant used for multiplication or division. "
13200 MES$(17)= " <shift>+<F4> will recall the constant used for multiplication & division. "
13300 MES$(18)= " <shift>+<F5> will store the last data line in a temporary register. "
13400 MES$(19)= " <shift>+<F6> will recall the stored last data line to the last data line. "
13500 MES$(20)= " <shift>+<F7> will store the result data line in a temporary register. "
13600 MES$(21)= " <shift>+<F8> will recall the stored result data line to the result data line. "
13700 MES$(22)= " <shift>+<F9> will cause the printer to print a report of the calculation. "
13800 MES$(23)= " <shift>+<F10> will start (stop) a running log of calculations on the printer. "
13900 MES$(24)= " <Ctrl>+<F1> will exchange the two input time data lines (for subtraction). "
14000 MES$(25)= " <Ctrl>+<F2> will make the printer print a list of the function key functions. "
14100 MES$(26)= " <Ctrl>+<F3> will place the current time of day into the first data line. "
14200 MES$(27)= " <Ctrl>+<F4> will place the current time of day into the last input data line. "
14300 MES$(28)= " <Ctrl>+<F5> will enter the day of the year into the first input data line. "
14400 MES$(29)= " <Ctrl>+<F6> will enter the day of the year into the last input data line. "
14500 MES$(30)= " <Ctrl>+<F7> will convert the result to a date from the start of the year. "
14600 MES$(31)= " <Ctrl>+<F8> will convert the result to a date from the current date. "
14700 MES$(32)= " <Ctrl>+<F9> is unassigned "
14800 MES$(33)= " <Ctrl>+<F10> is unassigned "
14900 MES$(34)= " <F1> - <F10> may be programed with numbers using [KEY n,"+CHR$(34)+"N...N"+CHR$(34)+"] before [RUN]."
15000 MES$(35)= " The result would be negative! Use <Ctrl>+<F1> to exchange input data lines. "
15100 MES$(36)= " The printer is off line or something! Fix the problem and try again. "
15200 MES$(37)= " "
15300 'GOTO 15900'-------------temporary skip to data screen-------------------
17700 IF X$="" THEN IF ET<>0 THEN GOTO 59200 ELSE 17600 ELSE IF X$=CHR$(27) THEN 15600 ELSE IF X$=CHR$(13) THEN ET=0:GOTO 32600 ELSE IF LEN(X$)>1 THEN 17800 ELSE 21300
28300 COLOR 0,7:PRINT "-";:COLOR 7,0:PRINT " MINUS, ";
28400 COLOR 0,7:PRINT "*";:COLOR 7,0:PRINT " TIMES, ";
28500 COLOR 0,7:PRINT "/";:COLOR 7,0:PRINT " DIVIDED BY, ";
28600 COLOR 0,7:PRINT CHR$(15);:COLOR 7,0:PRINT " BREAKDOWN.";
28700 FOR N=1 TO 5:READ A:POKE A,60:POKE A+1,&H0:NEXT N:RESTORE
28800 RETURN
28900 'function selection, line 5
29000 DATA 682,700,720,740,770
29100 'first input data line, line 3, start at 6
29200 DATA 328,352,376,398,422,462
29300 'constant, line 7, start at 12
29400 DATA 1036
29500 'second input data line, line 9, start at 13
29600 DATA 1288,1312,1336,1358,1382,1422
29700 'result year, 19
29800 DATA 1926
29900 'result week, 20
30000 DATA 1950
30100 'result day, 21
30200 DATA 1974,2294
30300 'result hour, 23
30400 DATA 1996,2316,2636
30500 'result minute, 26
30600 DATA 2020,2340,2660,2980
30700 'result second, 30
30800 DATA 2064,2384,2704,3024,3344
30900 'result totals, 35
31000 DATA 1652,1694,1736,2902,3222,3542
31100 'result cumulative units, 41
31200 DATA 2270,2614,2956,3300,3664
31300 FOR N=1 TO 18'------------install invisible pointers------------------
31400 READ A
31500 POKE A,60:POKE A+1,0
31600 NEXT N
31700 RESTORE:RETURN
31800 IF L=5 THEN IF C=32 THEN LOCATE L,1:GOSUB 28200:LOCATE L,R:ADDRESS=((160*L)-(160-2*R+1)):POKE ADDRESS,(PEEK(ADDRESS) OR &HF0):POKE ADDRESS+2,&H87
38200 IF O=5 OR O=0 THEN G=1:H=3:GOSUB 38700:GOTO 39600'convert input;sum up result
38300 IF O=4 THEN Y#(6)=Y#(1)/C#:W#(6)=W#(1)/C#:D#(6)=D#(1)/C#:H#(6)=H#(1)/C#:M#(6)=M#(1)/C#:S#(6)=S#(1)/C#:G=6:H=3:GOSUB 38700:GOTO 39600
38400 IF O=3 THEN Y#(6)=Y#(1)*C#:W#(6)=W#(1)*C#:D#(6)=D#(1)*C#:H#(6)=H#(1)*C#:M#(6)=M#(1)*C#:S#(6)=S#(1)*C#:G=6:H=3:GOSUB 38700:GOTO 39600
38500 IF O=2 THEN Y#(6)=Y#(1)-Y#(2):W#(6)=W#(1)-W#(2):D#(6)=D#(1)-D#(2):H#(6)=H#(1)-H#(2):M#(6)=M#(1)-M#(2):S#(6)=S#(1)-S#(2):G=6:H=3:GOSUB 38700:GOTO 39600
38600 IF O=1 THEN Y#(6)=Y#(1)+Y#(2):W#(6)=W#(1)+W#(2):D#(6)=D#(1)+D#(2):H#(6)=H#(1)+H#(2):M#(6)=M#(1)+M#(2):S#(6)=S#(1)+S#(2):G=6:H=3:GOSUB 38700:GOTO 39600
38700 '---------------------convert to time units------g=in - h=out-----
49600 LPRINT USING PR$;Y#(1);:LPRINT " years"SPC(21);:LPRINT USING PR$;Y#(2);:LPRINT " years"SPC(21);:LPRINT USING PR$;Y#(3);:LPRINT " years":LPRINT
49700 LPRINT USING PR$;W#(1);:LPRINT " weeks"SPC(21);:LPRINT USING PR$;W#(2);:LPRINT " weeks"SPC(21);:LPRINT USING PR$;W#(3);:LPRINT " weeks":LPRINT
49800 LPRINT USING PR$;D#(1);:LPRINT " days"SPC(22);:LPRINT USING PR$;D#(2);:LPRINT " days"SPC(22);:LPRINT USING PR$;D#(3);:LPRINT " days":LPRINT
49900 LPRINT USING PR$;H#(1);:LPRINT " hours"SPC(21);:LPRINT USING PR$;H#(2);:LPRINT " hours"SPC(21);:LPRINT USING PR$;H#(3);:LPRINT " hours":LPRINT
50000 LPRINT USING PR$;M#(1);:LPRINT " minutes"SPC(19);:LPRINT USING PR$;M#(2);:LPRINT " minutes"SPC(19);:LPRINT USING PR$;M#(3);:LPRINT " minutes":LPRINT
50100 LPRINT USING PR$;S#(1);:LPRINT " seconds"SPC(19);:LPRINT USING PR$;S#(2);:LPRINT " seconds"SPC(19);:LPRINT USING PR$;S#(3);:LPRINT " seconds":LPRINT
50200 GOTO 51700
50300 LPRINT USING PR$;Y#(1);:LPRINT " years"SPC(21);:LPRINT USING PR$;Y#(3);:LPRINT " years":LPRINT
50400 LPRINT USING PR$;W#(1);:LPRINT " weeks"SPC(21);:LPRINT USING PR$;W#(3);:LPRINT " weeks":LPRINT
50500 LPRINT USING PR$;D#(1);:LPRINT " days"SPC(22);:LPRINT USING PR$;D#(3);:LPRINT " days":LPRINT
50600 LPRINT USING PR$;H#(1);:LPRINT " hours"SPC(21);:LPRINT USING PR$;H#(3);:LPRINT " hours":LPRINT
50700 LPRINT USING PR$;M#(1);:LPRINT " minutes"SPC(19);:LPRINT USING PR$;M#(3);:LPRINT " minutes":LPRINT
50800 LPRINT USING PR$;S#(1);:LPRINT " seconds"SPC(19);:LPRINT USING PR$;S#(3);:LPRINT " seconds":LPRINT
50900 GOTO 51700
51000 LPRINT USING PR$;Y#(1);:LPRINT " years"SPC(70);:LPRINT USING PR$;Y#(3);:LPRINT " years":LPRINT
51100 LPRINT USING PR$;W#(1);:LPRINT " weeks"SPC(70);:LPRINT USING PR$;W#(3);:LPRINT " weeks":LPRINT
51200 LPRINT USING PR$;D#(1);:LPRINT " days"SPC(22);:LPRINT USING PR$;C#;:LPRINT SPC(27);:LPRINT USING PR$;D#(3);:LPRINT " days":LPRINT
51300 LPRINT USING PR$;H#(1);:LPRINT " hours"SPC(70);:LPRINT USING PR$;H#(3);:LPRINT " hours":LPRINT
51400 LPRINT USING PR$;M#(1);:LPRINT " minutes"SPC(66);:LPRINT USING PR$;M#(3);:LPRINT " minutes":LPRINT
51500 LPRINT USING PR$;S#(1);:LPRINT " seconds"SPC(66);:LPRINT USING PR$;S#(3);:LPRINT " seconds":LPRINT
59400 FOR NN=4 TO 6:A=TA(NN)-2:VALU$=" "+STR$(TI(NN)):GOSUB 44000:NEXT NN:GOTO 17600
59500 ON ERROR GOTO 59700:LPRINT CHR$(27)CHR$(64)CHR$(27)CHR$(69)CHR$(27)CHR$(45)CHR$(1)" LIST OF FUNCTION KEY FUNCTIONS for TIMECALC.":LPRINT CHR$(27)CHR$(45)CHR$(0)CHR$(27)CHR$(52)
59600 FOR N=4 TO 34:LPRINT MES$(N):LPRINT:NEXT N:LPRINT CHR$(12):ON ERROR GOTO 0:GOTO 17600